﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tmp
{
    class Test
    {
        static void Display(string name)
        {
            if (name == null)
                throw new ArgumentNullException("name");
            Console.WriteLine(name);
        }
        static void Main()
        {
            try { 
                Display(null);
            }
            catch (ArgumentNullException ex)
            {
                Console.WriteLine("Caught the exception");
            }
            Console.ReadKey();
        }
    }
}
